import request from '@/utils/request'

export const messageList = (data) => {
  return request({
    url: '/message',
    method: 'get',
    data
  })
}

export const changeReadStatus = (id) => {
  return request({
    url: `/message/${id}`,
    method: 'put'
  })
}

export const getNotReadMessage = (id) => {
  return request({
     url: `/message/read/${id}`,
     method: 'get'
  })
}

export const getMessageList = (data) => {
  return request({
    url: '/message/user',
    method: 'get',
    data
  })
}

export const addMessage = (data) => {
  return request({
    url: '/message',
    method: 'post',
    data
  })
}

export const updateMessageStatus = (data) => {
  return request({
    url: '/message/read',
    method: 'put',
    data
  })
}